package org.xxpay.pay.channel.you;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import org.springframework.util.Assert;
import org.xxpay.common.unify.AbstractPaymentConfig;

public class YouConfig extends AbstractPaymentConfig {

    public static final String CHANNEL_NAME = "you";
    public static final String RETURN_VALUE_SUCCESS = "00";
    public static final String ORDER_STATUS_SUCCESS = "SUCCESS";
    public static final String RESPONSE_RESULT_SUCCESS = "success"; // 返回上游成功
    public static final String RESPONSE_RESULT_FAIL = "fail";
    public static final String RESPONSE_RESULT_OK = "SUCCESS"; // 返回上游成功

    public static final String REQ_PAY_URL_FIXX = "/apisubmit";
    YouConfig(String payParam){
        Assert.notNull(payParam, "init sft config error");
        JSONObject object = JSON.parseObject(payParam);
        setAppId(object.getString("appId"));
        setPrivateKey(object.getString("privateKey"));
        setRequestUrl(object.getString("requestUrl"));
        setPayMode(object.getString("payType"));
    }
}
